{include file="layout/layout" /}
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>会员管理</h3>
                <h5>商城系统会员索引与管理</h5>
            </div>
        </div>
    </div>
    <!-- 操作说明 -->
    <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span title="收起提示" id="explanationZoom" style="display: block;"></span>
        </div>
        <ul>
            <li>会员列表管理, 可以给会员群发信息、邮件等.</li>
            <li>分销系统可以查看会员上下级信息.</li>
        </ul>
    </div>
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>会员列表</h3>
                <h5>(共<span id="user_count">{$count}</span>条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
            <form class="navbar-form form-inline"  id="search-form2" onsubmit="return false">
                <input type="hidden" name="order_by" value="user_id">
                <input type="hidden" name="sort" value="desc">
                <input type="hidden" name="mobile" value="" id="input-mobile" />
                <input type="hidden" name="email" value="" id="input-email" />
                <!--分销时查看下级人数都有哪些-->
                <input type="hidden" name="first_leader" value="">
                <input type="hidden" name="second_leader" value="">
                <input type="hidden" name="third_leader" value="">
                <!--搜索-->
                <div class="sDiv">
                    <div class="sDiv2">
                        <input type="text" id="search_key" size="30" class="qsbox" placeholder="手机或者邮箱...">
                        <input type="submit" class="btn" onclick="ajax_get_table('search-form2',1)" value="搜索">
                    </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                        <th class="sign" axis="col0">
                            <div style="width: 24px;"><i class="ico-check"></i></div>
                        </th>
                        <th align="left" abbr="user_id" axis="col3" class="">
                            <div style="text-align: center; width: 40px;" class="">ID</div>
                        </th>
                        <th align="left" abbr="nickname" axis="col4" class="">
                            <div style="text-align: center; width: 100px;" class="">会员昵称</div>
                        </th>
                        <th align="center" abbr="level" axis="col5" class="">
                            <div style="text-align: center; width: 50px;" class="">openID</div>
                        </th>
                        <th align="center" abbr="total_amount" axis="col6" class="">
                            <div style="text-align: center; width: 50px;" class="">累计消费</div>
                        </th>
                        <th align="center" abbr="email" axis="col6" class="">
                            <div style="text-align: center; width: 100px;" class="">unionID</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 30px;" class="">上级ID</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 30px;" class="">性别</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 100px;" class="">头像</div>
                        </th>
                        <th align="center" abbr="mobile" axis="col6" class="">
                            <div style="text-align: center; width: 80px;" class="">手机号码</div>
                        </th>
                        <th align="center" abbr="user_money" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">真实姓名</div>
                        </th>
                        <th align="center" abbr="pay_points" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">最近登录时间</div>
                        </th>
                        <th align="center" abbr="reg_time" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">注册日期</div>
                        </th>
                        <th align="center" axis="col1" class="handle">
                            <div style="text-align: center; width: 150px;">操作</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
                <div class="fbutton">
                    <a href="{}">
                        <div class="add" title="添加会员">
                            <span><i class="fa fa-plus"></i>添加会员</span>
                        </div>
                    </a>
                </div>
                <div class="fbutton">
                    <a href="{}">
                        <div class="add" title="添加会员">
                            <span><i class="fa fa-share"></i>导出会员</span>
                        </div>
                    </a>
                </div>
                <div class="fbutton">
                    <a onclick="send_message();">
                        <div class="add" title="发送站内信">
                            <span><i class="fa fa-send"></i>发送站内信</span>
                        </div>
                    </a>
                </div>
                <div class="fbutton">
                    <a onclick="send_mail();">
                        <div class="add" title="发送邮件">
                            <span><i class="fa fa-send-o"></i>发送邮件</span>
                        </div>
                    </a>
                </div>
            </div>
            <div style="clear:both"></div>
        </div>
         <div class="bDiv" style="height: auto;" id="ajax_return"><div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
    <table>
        <tbody>
            {foreach $list as $key=>$vo }
            <tr data-id="2592">
                <td class="sign">
                    <div style="width: 24px;"><i class="ico-check"></i></div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 40px;">{$vo.id}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 100px;">{$vo.nick_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 50px;">{$vo.openid}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 50px;">{$vo.id}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 100px;">{$vo.unionid}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 30px;">{$vo.parentid}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 30px;">{$vo.gender}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 100px;"><img src="{$vo.header}" alt=""></div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 80px;">{$vo.mobile}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$vo.true_name}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 60px;">{$vo.login_time}</div>
                </td>
                <td class="" align="left">
                    <div style="text-align: center; width: 120px;">{$vo.create_time}</div>
                </td>
                <td class="handle" align="center">
                    <div style="text-align: center; width: 170px; max-width:250px;">
                        <a class="btn blue" href="{:url('User/detail',['id'=>$vo.id])}"><i class="fa fa-pencil-square-o"></i>详情</a>
                        <a class="btn blue" href=""><i class="fa fa-search"></i>资金</a>
                        {switch $vo.static}
                            {case 1 }<a class="btn red" ><i class="fa fa-unlock-alt"></i><span class="del" gid="{$vo['id']}">冻结</span></a>{/case}
                            {case 2}<i class="fa fa-unlock"></i><span class="remo" jid="{$vo['id']}">已冻结</span></a>{/case}
                        {/switch}
                        >
                    </div>
                </td>
                <td class="" style="width: 100%;" align="">
                    <div>&nbsp;</div>
                </td>
            </tr>
            {/foreach}  
        </tbody>
    </table>
</div>
<!--分页位置-->
<center>{$list->render()|raw}</center>
</div>
</div>
</body>
<!--删除Ajax-->
<script>
    $('.del').click(function(){
        if(!confirm('确定要冻结吗 将执行禁用操作')) return false;
        var id = $(this).attr('gid');
        //alert(id);
        var t = $(this);
        //请求删除
        $.post("{:url('User/remove')}",{'id':id},function(data){
            //alert(data);
            if(data==1){
                alert('已冻结');
                t.html('已冻结');
                window.location.reload();
                // t.parent().parent().parent().parent().remove();
                // t.parent().parent().prev().remove();
                // t.parent().parent().parent().next().remove();
                // t.parent().siblings().remove();
                // t.prevAll().remove();
                // t.remove();
            }else{
                alert('冻结失败');
            }
        })
    })
    $('.remo').click(function(){
        if(!confirm('将要解除冻结')) return false;
        var id = $(this).attr('jid');
        //alert(id);
        var t = $(this);
        //请求删除
        $.get("{:url('User/remove')}",{'id':id},function(data){
            //alert(data);
            if(data==1){
                t.html('冻结');
                window.location.reload();
                // t.parent().parent().parent().parent().remove();
                // t.parent().parent().prev().remove();
                // t.parent().parent().parent().next().remove();
                // t.parent().siblings().remove();
                // t.prevAll().remove();
                // t.remove();
            }else{
                alert('解除失败');
            }
        })
    })
</script> 
</html>